package src.com.test.oneDay;

import javax.swing.*;
import java.util.ArrayList;
import java.util.List;

public class demo4 {


    String[] sumDict = {"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
    StringBuilder path = new StringBuilder();
    List<String> res = new ArrayList<>();

    public List<String> letterCombinations(String digits) {

        if(digits == null || digits.length() == 0){
            return res;
        }

        return res;
    }
    public void tracebacking(String digits,int index) {

        if(index == digits.length()){
            res.add(path.toString());
            return;
        }

        String n = sumDict[Integer.parseInt(digits.charAt(index)+"")];

        for(int i = 0;i < n.length();i++){
            path.append(n.charAt(i));
            tracebacking(digits,index+1);
            path.deleteCharAt(path.length()-1);
        }
    }



}
